"""Added vpn type to Order model

Revision ID: 745620561b18
Revises: d08beb34f56f
Create Date: 2023-05-08 09:41:36.783361

"""
import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import mysql

# revision identifiers, used by Alembic.
revision = "745620561b18"
down_revision = "d08beb34f56f"
branch_labels = None
depends_on = None


def upgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column(
        "order",
        sa.Column(
            "type",
            sa.Enum("proxy", "subscription", "vpn"),
            server_default="proxy",
            nullable=True,
        ),
    )
    op.drop_column("order", "is_subscription")
    # ### end Alembic commands ###


def downgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column(
        "order",
        sa.Column(
            "is_subscription",
            mysql.TINYINT(display_width=1),
            server_default=sa.text("'0'"),
            autoincrement=False,
            nullable=True,
        ),
    )
    op.drop_column("order", "type")
    # ### end Alembic commands ###
